import UnitList from './tableData.vue'
import PersonalList from './tableData.vue'
import { memberStateEnum, applyTypeEnum } from '@/enums/member'

const defaultColumns = [
  {
    title: '资料完成度',
    dataIndex: 'dataIntegrity',
    width: '140px',
    ellipsis: true,
    scopedSlots: { customRender: 'dataIntegrity',filterDropdown: 'dataIntegrityFilter' },
  },
  {
    title: '服务专员',
    dataIndex: 'attacheName',
    width: '140px',
    ellipsis: true,
    scopedSlots: { customRender: 'attacheName' },
  },
  {
    title: '小程序',
    dataIndex: 'isLogin',
    width: '120px',
    scopedSlots: { customRender: 'isLogin', filterDropdown: 'isLoginFilter' },
  },
  {
    title: '公众号',
    dataIndex: 'isOfficialAccount',
    width: '140px',
    scopedSlots: { customRender: 'isOfficialAccount', filterDropdown: 'isOfficialAccountFilter' },
  },
  {
    title: '排序',
    dataIndex: 'sort',
    slots: {title: 'sortTitle'},
    scopedSlots: { customRender: 'sort' },
    width: '150px',
  },
  {
    title: '负责人标签',
    dataIndex: 'tagUserList',
    width: '220px',
    scopedSlots: { customRender: 'tagUserList' },
  },
  {
    title: '操作',
    dataIndex: 'action',
    width: '245px',
    fixed: 'right',
    scopedSlots: {
      customRender: 'action',
      filterDropdown: 'actionFilter',
      filterIcon: 'actionFilterIcon'
    },
  },
]
export default {
  components: {
    UnitList,
    PersonalList
  },
  data() {
    return {
      tabList: [
        {
          key: 'unitList',
          tab: '单位会员',
        },
        {
          key: 'personalList',
          tab: '个人会员',
        },
      ],
      titleKey: 'unitList',
      unitListColumns: [
        {
          title: '序号',
          width: '100px',
          scopedSlots: { customRender: 'serial' },
        },
        {
          title: '会员名称',
          dataIndex: 'memberName',
          width: '200px',
          ellipsis: true,
        },
        {
          title: '会员职务',
          dataIndex: 'levelName',
          width: '140px',
          ellipsis: true,
          scopedSlots: {
            filterDropdown: 'levelNameFilter'
          }
        },
        {
          title: '负责人信息',
          width: '200px',
          scopedSlots: { customRender: 'userInfo' },
          align: 'left'
        },
        {
          title: '加入时间',
          dataIndex: 'joinTime',
          width: '140px',
          ellipsis: true,
        },
        {
          title: '到期时间',
          dataIndex: 'memberEndTime',
          width: '140px',
          ellipsis: true,
        },
        {
          title: '缴费状态',
          dataIndex: 'paymentStatus',
          width: '120px',
          ellipsis: true,
          scopedSlots: { customRender: 'paymentStatus', filterDropdown: 'paymentStatusFilter' },
        },
        ...defaultColumns,
      ],
      personalListColumns: [
        {
          title: '序号',
          width: '100px',
          scopedSlots: { customRender: 'serial' },
        },
        {
          title: '会员名称',
          dataIndex: 'memberName',
          width: '100px',
          ellipsis: true,
        },
        {
          title: '会员职务',
          dataIndex: 'levelName',
          width: '100px',
          ellipsis: true,
          scopedSlots: {
            filterDropdown: 'levelNameFilter'
          }
        },
        {
          title: '负责人信息',
          width: '200px',
          scopedSlots: { customRender: 'userInfo' },
          align: 'left'
        },
        {
          title: '单位名称',
          dataIndex: 'companyName',
          width: '200px',
          ellipsis: true,
        },
        {
          title: '单位职务',
          dataIndex: 'leadingSocialPosition',
          width: '100px',
          ellipsis: true,
        },
        {
          title: '加入时间',
          dataIndex: 'joinTime',
          width: '140px',
          ellipsis: true,
        },
        {
          title: '到期时间',
          dataIndex: 'memberEndTime',
          width: '140px',
          ellipsis: true,
        },
        {
          title: '缴费状态',
          dataIndex: 'paymentStatus',
          width: '120px',
          ellipsis: true,
          scopedSlots: { customRender: 'paymentStatus', filterDropdown: 'paymentStatusFilter' },
        },
        ...defaultColumns,
      ],
      memberStateEnum,
      applyTypeEnum,
    }
  },
  watch: {},
  methods: {
    onTabChange(key) {
      this.titleKey = key
    },
  },
  created() { },
  mounted() { },
}